import AudioManager from "./AudioManager";
import BButton from "./components/BButton";

const { ccclass, property } = cc._decorator;

@ccclass
export default class CommonClickSound extends cc.Component {

    start() {
        this.node.on(cc.Node.EventType.TOUCH_START, () => {
            let bbtn: BButton = this.getComponent(BButton);
            if(bbtn && !bbtn.enabled){
                return;
            }
            AudioManager.playFX('common/fx_Click');
        }, this);
    }
}
